package com.caishi.lkx.user.model;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zzw.common.entity.impl.BaseIntEntity;
import com.zzw.common.service.model.NameModel;
import com.zzw.common.service.model.base.BaseTreeModel;
import com.zzw.common.service.model.base.SortModel;
import lombok.*;

import java.util.List;

/**
 * @author by keray
 * date:2021/4/28 3:12 下午
 * 学校组织结构（部门）
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_department")
public class DepartmentModel extends BaseIntEntity<DepartmentModel> implements
        BaseTreeModel<DepartmentModel, Long>,
        SortModel<DepartmentModel>,
        NameModel<DepartmentModel, Long> {
    private String name;
    private Long groupId;
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long parentId;
    private Integer sort;
    @TableField(exist = false)
    private DepartmentModel parent;
    @TableField(exist = false)
    private List<DepartmentModel> children;
    @TableField(exist = false)
    private String groupName;

}
